package com.hrms.core;

import java.util.Map;

import org.antlr.stringtemplate.StringTemplate;
import org.antlr.stringtemplate.StringTemplateGroup;


public class TemplateManager {
	
	private static final String PATH = "WEB-INF/templates";
	private static final String GROUP = "FancyLeaveApp";
	
	private static final StringTemplateGroup templateGroup = new StringTemplateGroup(GROUP, PATH);

	public static enum Templates{
		reminder, taskChange, wfhRequest, employeeWelcome, teamPost, wallPost
	}
	
	public static String getCompiledBody(Templates template, Map attributes ){		
		StringTemplate strTemplate = templateGroup.getInstanceOf(template.name());
		strTemplate.setAttributes(attributes);
		return strTemplate.toString();
	}
	
	
}
